#ifndef TEMPLE_UTIL_STDC_H_
#define TEMPLE_UTIL_STDC_H_

#include <limits.h>
#include <stdint.h>
#include <float.h>
#include <assert.h>
#include <errno.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <signal.h>
#include <setjmp.h>
#include <ctype.h>
#include <wctype.h>
#include <locale.h>
#include <wchar.h>

#ifdef WIN32

#pragma warning(disable:4200)

#include <sys/types.h>
#include <sys/timeb.h>
#include <winsock2.h>
#include <Ws2ipdef.h>
#include <Ws2tcpip.h>

typedef struct sockaddr sockaddr_t;
typedef int socklen_t;

#define strdup _strdup
#define snprintf _snprintf
#define atoll _atoi64
#define strtof (float)strtod
#define inet_ntop InetNtop

#else //WIN32

#include <unistd.h>
#include <net/if.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/time.h>
#include <sys/timeb.h>
#include <sys/stat.h>
#include <sys/prctl.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <fcntl.h>
#include <syslog.h>

typedef struct sockaddr sockaddr_t;

#define ioctlsocket ::ioctl
#define closesocket ::close

#endif

#define OUT
#define INOUT

typedef uint64_t u64;
typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t  u8;

typedef int64_t  i64;
typedef int32_t  i32;
typedef int16_t  i16;
typedef int8_t   i8;

typedef float    f32;
typedef double   f64;

typedef unsigned long int ulong;
typedef unsigned short int ushort;

#include <string>
#include "stdcc.h"

#endif //TEMPLE_UTIL_STDC_H_
